using System;
using System.Data;
using System.Configuration;
using System.Web.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace webapp4U
{
    public class TheBeerHouseSection : ConfigurationSection
    {
        [ConfigurationProperty("defaultConnectionStringName", DefaultValue = "SqlServices")]
        public string DefaultConnectionStringName
        {
            get { return (string)base["defaultConnectionStringName"]; }
            set { base["connectionStdefaultConnectionStringNameringName"] = value; }
        }

        //[ConfigurationProperty("defaultCacheDuration", DefaultValue = "600")]
        //public int DefaultCacheDuration
        //{
        //    get { return (int)base["defaultCacheDuration"]; }
        //    set { base["defaultCacheDuration"] = value; }
        //}

        [ConfigurationProperty("namespace", DefaultValue = "webapp4U")]
        public string DefaultNamespace
        {
            get { return (string)base["namespace"]; }
            set { base["namespace"] = value; }
        }

        [ConfigurationProperty("AppName", DefaultValue = "webapp4U")]
        public string AppName
        {
            get { return (string)base["AppName"]; }
            set { base["AppName"] = value; }
        }

        //[ConfigurationProperty("contactForm", IsRequired = true)]
        //public ContactFormElement ContactForm
        //{
        //    get { return (ContactFormElement)base["contactForm"]; }
        //}


        [ConfigurationProperty("AppRoles", IsRequired = true)]
        public AppRolesElement AppRoles
        {
            get { return (AppRolesElement)base["AppRoles"]; }
        }

        [ConfigurationProperty("JobPreferences", IsRequired = true)]
        public JobPreferencesElement JobPreferences
        {
            get { return (JobPreferencesElement)base["JobPreferences"]; }
        }
    }


    //public class ContactFormElement : ConfigurationElement
    //{
    //    [ConfigurationProperty("mailSubject", DefaultValue = "Mail from TheBeerHouse: {0}")]
    //    public string MailSubject
    //    {
    //        get { return (string)base["mailSubject"]; }
    //        set { base["mailSubject"] = value; }
    //    }

    //    [ConfigurationProperty("mailTo", IsRequired = true)]
    //    public string MailTo
    //    {
    //        get { return (string)base["mailTo"]; }
    //        set { base["mailTo"] = value; }
    //    }

    //    [ConfigurationProperty("mailCC")]
    //    public string MailCC
    //    {
    //        get { return (string)base["mailCC"]; }
    //        set { base["mailCC"] = value; }
    //    }
    //}

    public class JobPreferencesElement : ConfigurationElement
    {

        [ConfigurationProperty("MaxUserJobCategory")]
        public string MaxUserJobCategory
        {
            get { return (string)base["MaxUserJobCategory"]; }
            set { base["MaxUserJobCategory"] = value; }
        }

        [ConfigurationProperty("MaxUserJobLocation")]
        public string MaxUserJobLocation
        {
            get { return (string)base["MaxUserJobLocation"]; }
            set { base["MaxUserJobLocation"] = value; }
        }
    }


    public class AppRolesElement : ConfigurationElement
    {
        [ConfigurationProperty("KhachHang")]
        public string KhachHang
        {
            get { return (string)base["KhachHang"]; }
            set { base["KhachHang"] = value; }
        }

        [ConfigurationProperty("DoanhNghiep")]
        public string DoanhNghiep
        {
            get { return (string)base["DoanhNghiep"]; }
            set { base["DoanhNghiep"] = value; }
        }

        [ConfigurationProperty("Admin")]
        public string Admin
        {
            get { return (string)base["Admin"]; }
            set { base["Admin"] = value; }
        }
    }


}